const axios = require('axios')

//热门搜索
async function hotBot() {
    var info = await axios({
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/search/hot/detail',
        port: 3000
    })
    return info
}

//搜索建议
async function googleSuggest(value) {
    var info = await axios({
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/search/suggest',
        port: 3000,
        params: {
            keywords: value
        }
    })
    return info
}

//搜索单曲
async function googleSong(value) {
    var info = await axios({
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/search',
        port: 3000,
        params: {
            keywords: value,
            type:1
        }
    })
    return info
}

//搜索专辑
async function googleAlbum(value) {
    var info = await axios({
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/search',
        port: 3000,
        params: {
            keywords: value,
            type: 10
        }
    })
    return info
}

export default {
    hotBot,
    googleSuggest,
    googleSong,
    googleAlbum
}